#!/bin/bash
set -ex
 

time=$(date "+%Y-%m-%d %H:%M:%S")
echo "${time}"
user=$(whoami)

echo "${user}"

kubeadm init --apiserver-advertise-address $(hostname -i) --pod-network-cidr 10.5.0.0/16

kubectl apply -f https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/kubeadm-kuberouter.yaml

kubectl taint nodes --all node-role.kubernetes.io/control-plane-

mkdir -p $HOME/.kube

cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

chown $(id -u):$(id -g) $HOME/.kube/config

docker system prune --all   --volumes -f

kubectl get pods,svc,ingress,nodes --all-namespaces